package com.study.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.*;


@Data
@TableName("student")
@ApiModel(value="学生表对象", description="学生基础数据表")
@EqualsAndHashCode(callSuper = true)
public class StudentDO extends BaseDO{

    @NotBlank(message = "姓名不能为空+")
    @Length(min = 1, max = 20)
    @TableField("name")
    @ApiModelProperty(value = "姓名", required = true)
    private String name;

    @NotNull(message = "年龄不能为空-")
    @Min(value = 0, message = "age最小不能小于0")
    @Max(value = 200, message="age最大不能超过200")
    @TableField("age")
    @ApiModelProperty(value = "年龄", required = true)
    private Integer age;

    @NotBlank(message = "配置定义不能为空=")
    @TableField("config_json")
    @ApiModelProperty(value = "配置定义", required = true)
    private String configJson;

}
